home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / exec < prev    next >
Text File  |  2001-04-06  |  1KB  |  37 lines

  1. SYNOPSIS
  2.         object exec(object new, object old)
  3.  
  4. DESCRIPTION
  5.         exec() switches the connection from the interactive object old
  6.         to the object new. If the new object is also interactive, it's
  7.         connection will be transferred to the old object, thus
  8.         exchaning the two connections between the object. If the new
  9.         object is not interactive, the old will not be interactive
  10.         anymore after the exec call succeeded.
  11.         It is used to load different "user objects" or to reconnect
  12.         link dead users.
  13.  
  14.         To provide security mechanisms, the interpreter calls
  15.         master->valid_exec(current_program, new, old), which must
  16.         return anything other than 0 to allow this exec() invocation.
  17.  
  18.         After the exec(), if arg 2 was this_player(), this_player()
  19.         becomes arg 1, else vice versa. Ditto for this_interactive().
  20.  
  21.         Take care when writing a simul-efun around exec(): the
  22.         'current_program' passed to the valid_exec() function will be
  23.         that of the simul-efun object. To get around this, use
  24.         bind_lambda() to bind #'exec to the real object and funcall()
  25.         the resulting closure.
  26.  
  27. EXAMPLE
  28.         ob = clone_object("std/player");
  29.         exec(ob, this_object());
  30.         destruct(this_object());
  31.  
  32. HISTORY
  33.     LDMud 3.2.9 added the switchover of this_interactive().
  34.  
  35. SEE ALSO
  36.         connect(M), disconnect(M), logon(A), interactive(E)
  37.